package com.eastfair.venuebooking.api;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eastfair.boot.request.PageParams;
import com.eastfair.builder.dto.ExhibitorDTO;
import com.eastfair.core.base.R;
import com.eastfair.venueservice.dto.BondManageDTO;
import com.eastfair.venueservice.dto.BondManagePageQuery;
import com.eastfair.venueservice.vo.BondManageVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author lyw
 * @Date 2023/2/14 16:17
 */
@FeignClient(value = "venue-services-manage/bondManage")
public interface BondManageFeign {

    /**
     * 分页查询保证金管理列表
     *
     * @param pageParams
     * @return
     */
    @PostMapping("/page/queryBondManageList")
    R<IPage<BondManageVO>> queryBondManageList(@RequestBody PageParams<BondManagePageQuery> pageParams);


    /**
     * 保存保证金管理
     *
     * @param bondManageDTO
     * @return
     */
    @ApiOperation(value = "保存保证金管理")
    @PostMapping(value = "/saveBondManageInfo")
    R<Boolean> saveBondManageInfo(@RequestBody BondManageDTO bondManageDTO);


    /**
     * 设置保证金管理金额
     *
     * @param bondManageDTO
     * @return
     */
    @ApiOperation(value = "设置保证金管理金额")
    @PostMapping(value = "/updateBondManageById")
    R<Boolean> updateBondManageById(@RequestBody BondManageDTO bondManageDTO);

    /**
     * 通过服务商id获取保证金集合
     *
     * @param exhibitorDTO
     * @return
     */
    @ApiOperation(value = "通过服务商id获取保证金集合")
    @PostMapping("/getBondManageList")
    R<List<BondManageVO>> getBondManageList(@RequestBody ExhibitorDTO exhibitorDTO);

    /**
     * 通过服务商id删除设置保证金信息
     *
     * @param id
     * @return
     */
    @ApiOperation(value = "通过服务商id删除设置保证金信息")
    @GetMapping(value = "/delBondManageByServiceProviderId/{id}")
    R<Boolean> delBondManageByServiceProviderId(@PathVariable(value = "id") Long id);

    /**
     * 支付保证金
     *
     * @param bondManageDTO bondManageDTO
     * @return R
     */
    @ApiOperation(value = "支付保证金")
    @PostMapping(value = "/saveBondPayRecordInfo")
    R<Boolean> payBond(@RequestBody BondManageDTO bondManageDTO);

    /**
     * 更新退款状态
     *
     * @param bondManageDTO the bond manage dto
     * @return the r
     */
    @PostMapping("/update/refundStatus")
    R<Boolean> updateRefundStatus(@RequestBody BondManageDTO bondManageDTO);
}
